@extends('layouts.base')

@section('title', '主板类型')

@section('admin-style')
	<link rel="stylesheet" href="{{ asset('/assets/plugins/dropify/dist/css/dropify.min.css') }}">
@stop

@section('content')
<div class="container-fluid">
	<!-- ============================================================== -->
	<!-- Bread crumb and right sidebar toggle -->
	<!-- ============================================================== -->
	<div class="row page-titles">
	    <div class="col-md-5 align-self-center">
	        <h3 class="text-themecolor">主板类型--添加</h3>
	    </div>
	    <div class="col-md-7 align-self-center">
	        <ol class="breadcrumb">
	            <li class="breadcrumb-item"><a href="javascript:void(0)">首页</a></li>
	            <li class="breadcrumb-item">主板类型管理</li>
	            <li class="breadcrumb-item active">主板类型添加</li>
	        </ol>
	    </div>
	</div>
	<div class="row">
	    <div class="col-lg-12">
	        <div class="card">
            	<div class="card-header bg-success">
                    <h4 class="m-b-0 text-white">添加</h4>
                </div>
                <div class="card-body"></div>
                <div class="card-body">
                    <form class="needs-validation" method="post" action="{{ route('admin.mainborads.store') }}" novalidate enctype="multipart/form-data">  
                        @csrf
                    	<div class="form-body">
	                        <div class="form-group row">
	                            <label class="control-label text-right col-md-2" for="">名称：</label>
	                            <div class="col-md-7">
	                                <input type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" id="" name="name" placeholder="名称" value="{{ old('name') }}" required>
                                    @if ($errors->has('name'))
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $errors->first('name') }}</strong>
                                        </span>
                                    @endif
	                                <div class="invalid-feedback">
                                       请填写名称
                                    </div>
	                            </div>
	                        </div>  
	                        <div class="form-group row">
	                            <label class="control-label text-right col-md-2" for="">货道数量：</label>
	                            <div class="col-md-7">
	                                <input type="number" class="form-control{{ $errors->has('freight_num') ? ' is-invalid' : '' }}" name="freight_num" id="" value="{{ old('freight_num') }}" required>
                                    @if ($errors->has('freight_num'))
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $errors->first('freight_num') }}</strong>
                                        </span>
                                    @endif
	                                <div class="invalid-feedback">
                                       请填写货道行数
                                    </div>
	                            </div>
	                        </div> 
                            <div class="form-group row">
                                <label class="control-label text-right col-md-2" for="">版本号：</label>
                                <div class="col-md-7">
                                    <input type="text" class="form-control{{ $errors->has('version') ? ' is-invalid' : '' }}" name="version" id="" placeholder="版本号" value="{{ old('version') }}" required>
                                    @if ($errors->has('version'))
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $errors->first('version') }}</strong>
                                        </span>
                                    @endif
                                    <div class="invalid-feedback">
                                       请填写版本号
                                    </div>
                                </div>
                            </div> 
                            <div class="form-group row">
                                <label class="control-label text-right col-md-2" for="">介绍：</label>
                                <div class="col-md-7">
                                    <textarea class="form-control" name="description" rows="5">
                                        {{ old('description') }}
                                    </textarea>
                                </div>
                            </div> 
	                    </div>           		
                      	<div class="form-actions">
                            <div class="row">
                                <div class="col-md-8">
                                    <div class="row">
                                        <div class="offset-sm-3 col-md-9">
                                            <button type="submit" class="btn btn-success"> <i class="fa fa-check"></i> 提交</button>
                                            <a href="{{ route('admin.mainborads.index') }}"><button type="button" class="btn btn-danger"><i class=" fas fa-times"></i> 取消</button></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
	    </div>
	</div>
</div>
@stop

@section('admin-js')

<!--Custom JavaScript -->
<script src="{{ asset('assets/js/validation.js') }}"></script>
<!-- jQuery file upload -->
<script src="{{ asset('assets/plugins/dropify/dist/js/dropify.min.js') }}"></script>


<script>
//For validation with custom styles
    (function() {
      'use strict';
      window.addEventListener('load', function() {
        // Fetch all the forms we want to apply custom Bootstrap validation styles to
        var forms = document.getElementsByClassName('needs-validation');
        // Loop over them and prevent submission
        var validation = Array.prototype.filter.call(forms, function(form) {
          form.addEventListener('submit', function(event) {
            if (form.checkValidity() === false) {
              event.preventDefault();
              event.stopPropagation();
            }
            form.classList.add('was-validated');
          }, false);
        });
      }, false);
    })();
    //vue
    //
    var my_vue = new Vue({
            el: '#app',
            data: function(){
               return {
                message: 'aabbb', 
               } 
            },
            mounted:function(){

            },
            created:function(){

            },
            method: {
                init:function(){

                },
                getData:function(){
                    
                }
            }
        }); 
</script>
@stop